package com.xishu.entity.plat;

import com.xishu.annotation.dao.FieldMapping;
import com.xishu.annotation.dao.NotModify;
import com.xishu.entity.AbstractEntity;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.util.List;

/**
 * 权限映射列表
 * sjgl_sjgllb,商家管理列表
 * sjgl_bjsj,编辑商家
 * sjgl_fdlb,分店列表
 * sjgl_bjfd,编辑分店
 * sjcdgl_zcl,主菜列表
 * sjzhgl_sjzhlb,账号列表
 * sjzhgl_fwylb,服务员列表
 * sjzhgl_xzfwy,新增服务员
 * sjzhgl_bjfwy,编辑服务员
 * sjdpsz_sjdpsz,店铺设置
 * sjcdgl,菜单管理
 * sjzfgl_zffsl,支付方式列表
 * sjzfgl_zffsgl,支付方式管理
 * sjzfgl_yhjl,优惠券列表
 * sjzfgl_zkl,折扣列表
 * sjpdgl_sjpdgl,排队管理
 * sjyyfx_ddlb,订单列表
 * xxfkgl_sjfkl,反馈列表
 * xt_gl系统管理
 */
@Entity(name = "privilege_mapping")
@Table(indexes = {@Index(columnList = "companyId")})
public class PrivilegeMapping extends AbstractEntity {
    @ApiModelProperty(value = "权限组的名称")
    private String name;

    @ApiModelProperty(value = "餐厅公司ID")
    @NotModify
    private Long companyId;

    @ApiModelProperty(value = "权限列表")
    @Transient
    @FieldMapping(desField = "privilegeJson", serialize = true)
    private List<String> privilegeList;

    @ApiModelProperty(value = "权限列表")
    @FieldMapping(desField = "privilegeList", serialize = false, genericType = "java.lang.String")
    @Lob
    @Column(columnDefinition="MEDIUMTEXT")
    private String privilegeJson;

    @ApiModelProperty(value = "权限级别")
    private Integer level;

    @ApiModelProperty(value = "是否是默认权限，只有餐厅管理员才有")
    private Boolean defaultPrivilege;

    public Boolean getDefaultPrivilege() {
        return defaultPrivilege;
    }

    public void setDefaultPrivilege(Boolean defaultPrivilege) {
        this.defaultPrivilege = defaultPrivilege;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getPrivilegeJson() {
        return privilegeJson;
    }

    public void setPrivilegeJson(String privilegeJson) {
        this.privilegeJson = privilegeJson;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getPrivilegeList() {
        return privilegeList;
    }

    public void setPrivilegeList(List<String> privilegeList) {
        this.privilegeList = privilegeList;
    }
}
